package com.ruoyi.common.page;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 通用 分页参数请求体
 * @author dingwei
 */
@Data
public class PageParamRequest implements Serializable {

    @ApiModelProperty(value = "查询页码")
    private Long pageNum;

    @ApiModelProperty(value = "查询数量")
    private Long pageSize;

    public Long getPageNum() {
        if (pageNum == null || pageNum < 1) {
            pageNum = 1L;
        }
        return pageNum;
    }

    public Long getPageSize() {
        if (pageSize == null || pageSize < 1) {
            pageSize = 10L;
        }
        return pageSize;
    }
}
